home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 66
/
Vol 66.iso
/
games
/
bluep.swf
/
scripts
/
frame_11
/
DoAction.as
Wrap
Text File
|
2013-04-24
|
15KB
|
525 lines
function setup()
{
if(_global.musicOn == true)
{
_global.myMusicPlayer.SetTrack("bluep_intro");
_global.myMusicPlayer.SetMaxVolume(100);
_global.myMusicPlayer.PlayWithCrossFade(0.5);
}
cacheItAll();
main_titleStartX = 118.8;
main_titleStartY = -129.6;
play_buttonStartX = 84;
play_buttonStartY = 521.4;
settings_buttonStartX = 166.5;
settings_buttonStartY = 521.4;
credits_buttonStartX = 247.7;
credits_buttonStartY = 521.4;
more_buttonStartX = 329.1;
more_buttonStartY = 521.4;
main_titleMainX = 118.8;
main_titleMainY = 170.4;
play_buttonMainX = 84;
play_buttonMainY = 291.4;
settings_buttonMainX = 166.5;
settings_buttonMainY = 291.4;
credits_buttonMainX = 247.7;
credits_buttonMainY = 291.4;
more_buttonMainX = 329.1;
more_buttonMainY = 291.4;
main_titleCreditsX = 123.8;
main_titleCreditsY = 33.4;
play_buttonCreditsX = 86;
play_buttonCreditsY = 441.4;
settings_buttonCreditsX = 168.5;
settings_buttonCreditsY = 441.4;
credits_buttonCreditsX = 249.7;
credits_buttonCreditsY = 441.4;
more_buttonCreditsX = 331.1;
more_buttonCreditsY = 441.4;
main_titleSettingsX = 89.8;
main_titleSettingsY = 80.4;
play_buttonSettingsX = 89;
play_buttonSettingsY = 179.3;
settings_buttonSettingsX = 171.5;
settings_buttonSettingsY = 179.3;
credits_buttonSettingsX = 252.7;
credits_buttonSettingsY = 179.3;
more_buttonSettingsX = 334.1;
more_buttonSettingsY = 179.3;
settings_menuStartX = 86.8;
settings_menuStartY = 517.3;
settings_menuEndX = 86.8;
settings_menuEndY = 217.3;
credits_menuStartX = 498.8;
credits_menuStartY = 165.8;
credits_menuEndX = 137.9;
credits_menuEndY = 165.8;
hotkeys_buttonStartX = 503.4;
hotkeys_buttonStartY = 213.9;
hotkeys_buttonEndX = 333.4;
hotkeys_buttonEndY = 213.9;
hotkeys_menuStartX = -290.6;
hotkeys_menuStartY = 247.6;
hotkeys_menuEndX = 99.4;
hotkeys_menuEndY = 247.6;
moveMe(_root.main_title,main_titleMainX,main_titleMainY);
moveMe(_root.play_button,play_buttonMainX,play_buttonMainY);
moveMe(_root.settings_button,settings_buttonMainX,settings_buttonMainY);
moveMe(_root.credits_button,credits_buttonMainX,credits_buttonMainY);
moveMe(_root.more_button,more_buttonMainX,more_buttonMainY);
hasFocus = "";
tweenClassBusy = false;
_global.goToGame = false;
_global.menuPage = "main";
_root.cleanupBullets();
_root.scaleIt(main_title,100);
}
function run()
{
_global.myMusicPlayer.RunPlayer();
mouseCurserAdjust();
}
function mouseCurserAdjust()
{
_root.crosshair._x = _xmouse;
_root.crosshair._y = _ymouse;
}
function alphaIt(mc, scale)
{
this.onEnterFrame = function()
{
if(scale < mc._alpha)
{
mc._alpha -= 3;
if(mc._alpha <= scale)
{
mc._alpha = scale;
mc._alpha = scale;
delete this.onEnterFrame;
}
}
else
{
mc._alpha += 3;
if(mc._alpha >= scale)
{
mc._alpha = scale;
mc._alpha = scale;
delete this.onEnterFrame;
}
}
};
}
function scaleIt(mc, scale)
{
this.onEnterFrame = function()
{
if(scale < mc._xscale)
{
mc._xscale -= 3;
mc._yscale -= 3;
if(mc._xscale <= scale)
{
mc._xscale = scale;
mc._yscale = scale;
delete this.onEnterFrame;
}
}
else
{
mc._xscale += 3;
mc._yscale += 3;
if(mc._xscale >= scale)
{
mc._xscale = scale;
mc._yscale = scale;
delete this.onEnterFrame;
}
}
};
}
function moveMe(mc, xVal, yVal)
{
var _loc6_ = xVal;
var _loc7_ = yVal;
var _loc4_ = 0.9;
var _loc5_ = _global.FPSforTweenClass;
var _loc8_ = mc._x;
var _loc9_ = mc._y;
myTweening2 = new mx.transitions.Tween(mc,"_x",mx.transitions.easing.Strong.easeOut,_loc8_,_loc6_,_loc4_,true);
myTweening2 = new mx.transitions.Tween(mc,"_y",mx.transitions.easing.Strong.easeOut,_loc9_,_loc7_,_loc4_,true);
myTweening2.FPS = _loc5_;
myTweening2.FPS = _loc5_;
myTweening2.onMotionFinished = function()
{
if(_global.goToGame)
{
_root.gotoAndPlay("game");
_global.goToGame = false;
}
tweenClassBusy = false;
};
}
function OutputValue(fieldName, keyCode)
{
var textRef = eval("this." + fieldName);
var returnValue = "";
switch(keyCode)
{
case 8:
returnValue = "BACKSPACE";
break;
case 20:
returnValue = "CAPSLOCK";
break;
case 17:
returnValue = "CONTROL";
break;
case 46:
returnValue = "DELETE";
break;
case 40:
returnValue = "DOWN";
break;
case 35:
returnValue = "END";
break;
case 13:
returnValue = "ENTER";
break;
case 27:
returnValue = "ESCAPE";
break;
case 36:
returnValue = "HOME";
break;
case 45:
returnValue = "INSERT";
break;
case 37:
returnValue = "LEFT";
break;
case 34:
returnValue = "PGDN";
break;
case 33:
returnValue = "PGUP";
break;
case 39:
returnValue = "RIGHT";
break;
case 16:
returnValue = "SHIFT";
break;
case 32:
returnValue = "SPACE";
break;
case 9:
returnValue = "TAB";
break;
case 38:
returnValue = "UP";
break;
case 186:
returnValue = ";";
break;
case 187:
returnValue = "=";
break;
case 189:
returnValue = "-";
break;
case 191:
returnValue = "/";
break;
case 192:
returnValue = "`";
break;
case 219:
returnValue = "[";
break;
case 220:
returnValue = "\\";
break;
case 221:
returnValue = "]";
break;
case 222:
returnValue = "\'";
break;
case 188:
returnValue = ",";
break;
case 190:
returnValue = ".";
break;
case 96:
returnValue = "NUMPAD 0";
break;
case 97:
returnValue = "NUMPAD 1";
break;
case 98:
returnValue = "NUMPAD 2";
break;
case 99:
returnValue = "NUMPAD 3";
break;
case 100:
returnValue = "NUMPAD 4";
break;
case 101:
returnValue = "NUMPAD 5";
break;
case 102:
returnValue = "NUMPAD 6";
break;
case 103:
returnValue = "NUMPAD 7";
break;
case 104:
returnValue = "NUMPAD 8";
break;
case 105:
returnValue = "NUMPAD 9";
break;
case 106:
returnValue = "MULTIPLY";
break;
case 107:
returnValue = "ADD";
break;
case 109:
returnValue = "SUBTRACT";
break;
case 110:
returnValue = "DECIMAL";
break;
case 111:
returnValue = "DIVIDE";
break;
default:
returnValue = chr(keyCode);
returnValue.toUpperCase();
}
textRef.text = returnValue;
}
function UnselectOthers(myName)
{
if(myName != "upClip")
{
_root.hotkeys_menu.upClip.gotoAndStop(1);
}
else
{
hasFocus = myName;
}
if(myName != "downClip")
{
_root.hotkeys_menu.downClip.gotoAndStop(1);
}
else
{
hasFocus = myName;
}
if(myName != "leftClip")
{
_root.hotkeys_menu.leftClip.gotoAndStop(1);
}
else
{
hasFocus = myName;
}
if(myName != "rightClip")
{
_root.hotkeys_menu.rightClip.gotoAndStop(1);
}
else
{
hasFocus = myName;
}
if(myName != "jumpClip")
{
_root.hotkeys_menu.jumpClip.gotoAndStop(1);
}
else
{
hasFocus = myName;
}
}
function cacheItAll()
{
_root.crosshair.cacheAsBitmap = true;
_root.play_button.cacheAsBitmap = true;
_root.settings_button.cacheAsBitmap = true;
_root.settings_button.cacheAsBitmap = true;
_root.credits_button.cacheAsBitmap = true;
_root.more_button.cacheAsBitmap = true;
_root.hotkeys_button.cacheAsBitmap = true;
}
stop();
var main_titleStartX;
var main_titleStartY;
var play_buttonStartX;
var play_buttonStartY;
var settings_buttonStartX;
var settings_buttonStartY;
var credits_buttonStartX;
var credits_buttonStartY;
var more_buttonStartX;
var more_buttonStartY;
var main_titleMainX;
var main_titleMainY;
var play_buttonMainX;
var play_buttonMainY;
var settings_buttonMainX;
var settings_buttonMainY;
var credits_buttonMainX;
var credits_buttonMainY;
var more_buttonMainX;
var more_buttonMainY;
var main_titleCreditsX;
var main_titleCreditsY;
var play_buttonCreditsX;
var play_buttonCreditsY;
var settings_buttonCreditsX;
var settings_buttonCreditsY;
var credits_buttonCreditsX;
var credits_buttonCreditsY;
var more_buttonCreditsX;
var more_buttonCreditsY;
var main_titleSettingsX;
var main_titleSettingsY;
var play_buttonSettingsX;
var play_buttonSettingsY;
var settings_buttonSettingsX;
var settings_buttonSettingsY;
var credits_buttonSettingsX;
var credits_buttonSettingsY;
var more_buttonSettingsX;
var more_buttonSettingsY;
var settings_menuStartX;
var settings_menuStartY;
var settings_menuEndX;
var settings_menuEndY;
var credits_menuStartX;
var credits_menuStartY;
var credits_menuEndX;
var credits_menuEndY;
var hotkeys_buttonStartX;
var hotkeys_buttonStartY;
var hotkeys_buttonEndX;
var hotkeys_buttonEndY;
var hotkeys_menuStartX;
var hotkeys_menuStartY;
var hotkeys_menuEndX;
var hotkeys_menuEndY;
var hasFocus;
var tweenClassBusy;
_root.onMouseDown = function()
{
};
_root.play_button.onPress = function()
{
if(!tweenClassBusy)
{
tweenClassBusy = true;
moveMe(_root.credits_menu,credits_menuStartX,credits_menuStartY);
moveMe(_root.settings_menu,settings_menuEndX,settings_menuEndY + 300);
moveMe(_root.play_button,play_buttonStartX,play_buttonStartY);
moveMe(_root.settings_button,settings_buttonStartX,settings_buttonStartY);
moveMe(_root.credits_button,credits_buttonStartX,credits_buttonStartY);
moveMe(_root.more_button,more_buttonStartX,more_buttonStartY);
moveMe(_root.hotkeys_button,hotkeys_buttonStartX,hotkeys_buttonStartY);
moveMe(_root.hotkeys_menu,hotkeys_menuStartX,hotkeys_menuStartY);
_global.goToGame = true;
moveMe(_root.main_title,main_titleStartX,main_titleStartY);
_global.menuPage = "main";
}
};
_root.settings_button.onPress = function()
{
if(!tweenClassBusy)
{
tweenClassBusy = true;
scaleIt(main_title,80);
moveMe(_root.credits_menu,credits_menuStartX,credits_menuStartY);
moveMe(_root.play_button,play_buttonSettingsX,play_buttonSettingsY);
moveMe(_root.settings_button,settings_buttonSettingsX,settings_buttonSettingsY);
moveMe(_root.credits_button,credits_buttonSettingsX,credits_buttonSettingsY);
moveMe(_root.more_button,more_buttonSettingsX,more_buttonSettingsY);
moveMe(_root.main_title,main_titleSettingsX,main_titleSettingsY);
moveMe(_root.settings_menu,settings_menuEndX,settings_menuEndY);
moveMe(_root.hotkeys_button,hotkeys_buttonEndX,hotkeys_buttonEndY);
moveMe(_root.hotkeys_menu,hotkeys_menuStartX,hotkeys_menuStartY);
_global.menuPage = "settings";
}
};
_root.credits_button.onPress = function()
{
if(!tweenClassBusy)
{
tweenClassBusy = true;
scaleIt(main_title,100);
moveMe(_root.play_button,play_buttonCreditsX,play_buttonCreditsY);
moveMe(_root.settings_button,settings_buttonCreditsX,settings_buttonCreditsY);
moveMe(_root.credits_button,credits_buttonCreditsX,credits_buttonCreditsY);
moveMe(_root.more_button,more_buttonCreditsX,more_buttonCreditsY);
moveMe(_root.main_title,main_titleCreditsX,main_titleCreditsY);
moveMe(_root.settings_menu,settings_menuEndX,settings_menuEndY + 300);
moveMe(_root.credits_menu,credits_menuEndX,credits_menuEndY);
moveMe(_root.hotkeys_button,hotkeys_buttonStartX,hotkeys_buttonStartY);
moveMe(_root.hotkeys_menu,hotkeys_menuStartX,hotkeys_menuStartY);
_global.menuPage = "credits";
}
};
_root.hotkeys_button.onPress = function()
{
if(!tweenClassBusy)
{
tweenClassBusy = true;
moveMe(_root.settings_menu,settings_menuStartX,settings_menuStartY);
moveMe(_root.hotkeys_menu,hotkeys_menuEndX,hotkeys_menuEndY);
}
};
_root.more_button.onRelease = function()
{
getUrl("http://www.armorgames.com/", "_blank");
};
var keyListener = new Object();
keyListener.onKeyDown = function()
{
if(hasFocus == "upClip")
{
_global.hotKey_up = Key.getCode();
OutputValue("_root.hotkeys_menu.up_txt",_global.hotKey_up);
}
if(hasFocus == "downClip")
{
_global.hotKey_down = Key.getCode();
OutputValue("_root.hotkeys_menu.down_txt",_global.hotKey_down);
}
if(hasFocus == "leftClip")
{
_global.hotKey_left = Key.getCode();
OutputValue("_root.hotkeys_menu.left_txt",_global.hotKey_left);
}
if(hasFocus == "rightClip")
{
_global.hotKey_right = Key.getCode();
OutputValue("_root.hotkeys_menu.right_txt",_global.hotKey_right);
}
if(hasFocus == "jumpClip")
{
_global.hotKey_jump = Key.getCode();
OutputValue("_root.hotkeys_menu.jump_txt",_global.hotKey_jump);
}
};
Key.addListener(keyListener);
OutputValue("_root.hotkeys_menu.up_txt",_global.hotKey_up);
OutputValue("_root.hotkeys_menu.down_txt",_global.hotKey_down);
OutputValue("_root.hotkeys_menu.left_txt",_global.hotKey_left);
OutputValue("_root.hotkeys_menu.right_txt",_global.hotKey_right);
OutputValue("_root.hotkeys_menu.jump_txt",_global.hotKey_jump);